import request from '@/utils/request'

export function login(data) {
  return request({
    url: '/sys/login',
    method: 'post',
    data
  })
}
// 获取用户的详情信息('名称')
export function getProfile(token) {
  return request({
    url: '/sys/profile',
    method: 'post'
  })
}
// 获取用户的详细信息(用户头像)
export function getUserInfoById(id) {
  return request({
    url: `/sys/user/${id}`
  })
}
export function saveUserDetailById(data) {
  return request({
    url: `/sys/user/${data.id}`,
    method: 'put',
    data
  })
}

export function assignRoles(data) {
  return request({
    url: '/sys/user/assignRoles',
    method: 'put',
    data
  })
}
